<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>后台管理系统</title>
  <!-- 支持响应式布局 -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  {load href="/static/admin/bower_components/bootstrap/dist/css/bootstrap.min.css" /}
  <!-- 象形字体 -->
  {load href="/static/admin/bower_components/font-awesome/css/font-awesome.min.css" /}
  <!-- 图标 -->
  {load href="/static/admin/bower_components/Ionicons/css/ionicons.min.css" /}
  <!-- 主题风格样式 -->
  {load href="/static/admin/dist/css/AdminLTE.min.css" /}
  <!-- AdminLTE 皮肤.这里选择的是skin-blue样式，我们还可以有其他皮肤可以选择. -->
  {load href="/static/admin/dist/css/skins/skin-blue.min.css" /}
  <!-- 兼容IE9以下浏览器 -->
  <!--[if lt IE 9]>
  {load href="/static/admin/local/js/html5shiv.min.js" /}
  {load href="/static/admin/local/js/respond.min.js" /}
  <![endif]-->
  <!-- Google Font -->
  {load href="/static/admin/local/css/google_fonts.css" /}
  <style>
    ul.pagination{
      float: right!important;
      margin:0px;
    }
  </style>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">

  <!-- Main Header 主体页头 -->
  <header class="main-header">

    <!-- Logo -->
    <a href="{:url('index/index')}" class="logo">
      <!-- 侧栏迷你徽标 mini 50x50 pixels -->
      <span class="logo-mini"><b>餐</b></span>
      <!-- 常规状态标志和移动设备标志 -->
      <span class="logo-lg"><b>订餐系统后台管理</b></span>
    </a>

    <!-- Header Navbar 首部导航栏 -->
    <nav class="navbar navbar-static-top" role="navigation">
      <!-- Sidebar toggle button 侧边栏切换按钮 -->
      <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
        <span class="sr-only">切换导航</span>
      </a>
      <!-- 右栏菜单 -->
      <div class="navbar-custom-menu">
        <ul class="nav navbar-nav">
          <!-- messages-menu 消息菜单: 样式可以在 dropdown.less 中找到 -->
          <li class="dropdown messages-menu">
            <!-- Menu toggle button 菜单切换按钮 -->
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
              <i class="fa fa-envelope-o"></i>
              <span class="label label-success">4</span>
            </a>
            <ul class="dropdown-menu">
              <li class="header">你有4个短信息</li>
              <li>
                <!-- 内部菜单：包含消息 -->
                <ul class="menu">
                  <li><!-- start message 信息开始 -->
                    <a href="#">
                      <div class="pull-left">
                        <!-- User Image 使用图片 -->
                        <img src="/static/admin/dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">
                      </div>
                      <!-- 消息标题和时间 -->
                      <h4>
                        我们都支持团队
                        <small><i class="fa fa-clock-o"></i> 5 分钟</small>
                      </h4>
                      <!-- The message -->
                      <p>Why not buy a new awesome theme?</p>
                    </a>
                  </li>
                  <!-- end message -->
                </ul>
                <!-- /.menu -->
              </li>
              <li class="footer"><a href="#">查看所有信息</a></li>
            </ul>
          </li>
          <!-- /.messages-menu -->

          <!-- Notifications Menu 通知菜单 -->
          <li class="dropdown notifications-menu">
            <!-- Menu toggle button  菜单切换按钮 -->
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
              <i class="fa fa-bell-o"></i>
              <span class="label label-warning">10</span>
            </a>
            <ul class="dropdown-menu">
              <li class="header">你有10条通知信息</li>
              <li>
                <!-- Inner Menu: contains the notifications -->
                <ul class="menu">
                  <li><!-- start notification -->
                    <a href="#">
                      <i class="fa fa-users text-aqua"></i> 今天有5名新成员加入
                    </a>
                  </li>
                  <!-- end notification -->
                </ul>
              </li>
              <li class="footer"><a href="#">查看全部</a></li>
            </ul>
          </li>
          <!-- Tasks Menu 任务菜单 -->
          <li class="dropdown tasks-menu">
            <!-- Menu Toggle Button 菜单切换按钮 -->
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
              <i class="fa fa-flag-o"></i>
              <span class="label label-danger">9</span>
            </a>
            <ul class="dropdown-menu">
              <li class="header">你有9个任务</li>
              <li>
                <!-- Inner menu: contains the tasks -->
                <ul class="menu">
                  <li><!-- Task item -->
                    <a href="#">
                      <!-- Task title and progress text -->
                      <h3>
                        设计一些按钮
                        <small class="pull-right">20%</small>
                      </h3>
                      <!-- The progress bar -->
                      <div class="progress xs">
                        <!-- Change the css width attribute to simulate progress -->
                        <div class="progress-bar progress-bar-aqua" style="width: 20%" role="progressbar"
                             aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">
                          <span class="sr-only">20% 完成</span>
                        </div>
                      </div>
                    </a>
                  </li>
                  <!-- end task item -->
                </ul>
              </li>
              <li class="footer">
                <a href="#">查看所有任务</a>
              </li>
            </ul>
          </li>
          <!-- User Account Menu -->
          <li class="dropdown user user-menu">
            <!-- Menu Toggle Button -->
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
              <!-- The user image in the navbar-->
              <img src="/static/admin/dist/img/user2-160x160.jpg" class="user-image" alt="User Image">
              <!-- hidden-xs hides the username on small devices so only the image appears. -->
              <span class="hidden-xs">{$Request.session.adminuser.nickname}</span>
            </a>
            <ul class="dropdown-menu">
              <!-- The user image in the menu -->
              <li class="user-header">
                <img src="/static/admin/dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">

                <p>
                  {$Request.session.adminuser.nickname} - 管理员
                  <small>{$Request.session.adminuser.create_at|date='Y年m月d日'}加入</small>
                </p>
              </li>
              <!-- Menu Footer-->
              <li class="user-footer">
                <div class="pull-left">
                  <a href="#" class="btn btn-default btn-flat">个人信息</a>
                </div>
                <div class="pull-right">
                  <a href="{:url('index/logout')}" class="btn btn-default btn-flat">退 出</a>
                </div>
              </li>
            </ul>
          </li>
          
        </ul>
      </div>
    </nav>
  </header>

  <!-- 左侧柱。包含徽标和边栏 -->
  <aside class="main-sidebar">

    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">

      <!-- Sidebar user panel (optional) -->
      <div class="user-panel">
        <div class="pull-left image">
          <img src="/static/admin/dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">
        </div>
        <div class="pull-left info">
          <p>{$Request.session.adminuser.nickname} . 管理员</p>
          <!-- Status -->
          <a href="#"><i class="fa fa-circle text-success"></i> 在线</a>
        </div>
      </div>

      <!-- Sidebar Menu -->
      <ul class="sidebar-menu" data-widget="tree">
        <li class="header">主要导航</li>
        <!-- 导航列表，你可以自行更改图标 -->
        <li class="active"><a href="{:url('index/index')}"><i class="fa fa-home"></i> <span>首页</span></a></li>
        
        <li><a href="{:url('/admin/user')}"><i class="fa fa-users"></i> <span>账号管理</span></a></li>
        <li><a href="shop.html"><i class="fa fa-sitemap"></i> <span>店铺管理</span></a></li>
        <li class="treeview">
          <a href="category.html"><i class="fa fa-cutlery"></i> <span>菜品管理</span>
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
          </a>
          <ul class="treeview-menu">
            <li><a href="category.html"> <i class="fa fa-circle-o"></i> 菜品分类</a></li>
            <li><a href="product.html"> <i class="fa fa-circle-o"></i> 菜品信息</a></li>
          </ul>
        </li>
        <li><a href="orders.html"><i class="fa fa-shopping-cart"></i> <span>订单管理</span></a></li>
        <li><a href="/admin/user"><i class="fa fa-user"></i> <span>会员管理</span></a></li>
        <li><a href="#"><i class="fa fa-key"></i> <span>权限管理</span></a></li>
        <li><a href="#"><i class="fa fa-gear"></i> <span>系统配置</span></a></li>
        <li><a href="#"><i class="fa fa-unlock-alt"></i> <span>认证体系</span></a></li>
      </ul>
      <!-- /.sidebar-menu -->
    </section>
    <!-- /.sidebar -->
  </aside>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
  {block name="mainbody"}{/block}
  </div>
  <!-- /.content-wrapper -->

  <!-- Main Footer -->
  <footer class="main-footer">
    <!-- To the right -->
    <div class="pull-right hidden-xs">
      PHP220期
    </div>
    <!-- Default to the left -->
    <strong>Copyright &copy; 2020 <a href="#">北京****有限公司</a>.</strong> 版权所有
  </footer>

  <!-- 添加侧栏的背景。必须放置此处紧接在控制侧边栏之后 -->
  <div class="control-sidebar-bg"></div>
</div>
<!-- ./wrapper -->

<!-- edu-model提示框模板 -->
<div id="edu-alert" class="modal">
  <div class="modal-dialog modal-sm">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
        <h5 class="modal-title"><i class="fa fa-exclamation-circle"></i> [Title]</h5>
      </div>
      <div class="modal-body small">
        <p>[Message]</p>
      </div>
      <div class="modal-footer" >
        <button type="button" class="btn btn-primary ok" data-dismiss="modal">[BtnOk]</button>
        <button type="button" class="btn btn-default cancel" data-dismiss="modal">[BtnCancel]</button>
      </div>
    </div>
  </div>
</div>
<!-- edu-model-end -->

<!-- REQUIRED JS SCRIPTS -->
  
<!-- jQuery 3 -->
{load href="/static/admin/bower_components/jquery/dist/jquery.min.js" /}
<!-- Bootstrap 3.3.7 -->
{load href="/static/admin/bower_components/bootstrap/dist/js/bootstrap.min.js" /}
<!-- AdminLTE App -->
{load href="/static/admin/dist/js/adminlte.min.js" /}

{load href="/static/admin/dist/js/edu-modal-alert-confirm.js" /}

<!-- 此处可以添加SimLoopl和FastClick插件，用于增强用户体验。 -->

<script type="text/javascript">
  function doDelete(del_url){
    Modal.confirm({
        msg: "确定要删除吗？",
        title: ' 信息提示',
        btnok: '确定',
        btncl:'取消'
      }).on(function (e){
        if(e){ //判断是否是点击确定
          $.ajax({
            //请求方式
            type:"DELETE",
            //请求地址
            url : del_url,
            //数据，json字符串
            dataType:'json',
            //请求成功
            success : function(result) {
                console.log(result);
                if(result.error=="yes"){
                  //Modal.alert({msg: "成功删除",title: ' 信息提示',btnok: '确定',btncl:'取消'});
                  window.location.reload();
                }else{
                  Modal.alert({msg: "成功失败",title: ' 信息提示',btnok: '确定',btncl:'取消'});
                }
            },
            //请求失败，包含具体的错误信息
            error : function(e){
                console.log(e.status);
                console.log(e.responseText);
            }
          });
          
        }
      });
  }
</script>
</body>
</html>